import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import leftnavView from '../views/leftNav/LeftNavView.vue'
import { Layout } from 'ant-design-vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'leftnavView',
      component: leftnavView,
      children: [
        {
          path: '/home',
          name: 'home',
          component: HomeView
        },
        {
          path: '/about',
          name: 'about',
          // 在访问路由的时候惰性加载
          component: () => import('../views/AboutView.vue')
        },
        {
          path: '/test',
          name: 'test',
          // 在访问路由的时候惰性加载
          component: () => import('../views/TestView.vue')
        },
        {
          path: '/homePage',
          name: 'homePage',
          // 在访问路由的时候惰性加载
          component: () => import('../views/homepage/HomeView.vue')
        },
        {
          path: '/department',
          name: 'department',
          // 在访问路由的时候惰性加载
          component: () => import('../views/department/DepartmentView.vue')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      // 在访问路由的时候惰性加载
      component: () => import('../views/login/LoginView.vue')
    }
  ]
})

export default router
